﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_SMS_ReadMsg]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_SMS_ReadMsg];
GO
CREATE PROCEDURE [dbo].[sproc_SMS_ReadMsg]
    @msgids             nvarchar(2000),
    @username             nvarchar(50)
    
/*

============================================================
功能:    短消息读取
参数:
    @msgids                     nvarchar,    :    消息ID字符串
    @username                     nvarchar,    :    用户名

============================================================

*/

AS
    DECLARE @Sql NVarchar(4000)
    SET @SQL = 'UPDATE UDS_SMS_Receiver    SET isread=1     WHERE msgid in (' + @msgids + ') and receiver ='''+ @username+''''
    EXEC (@SQL)